cmake_minimum_required(VERSION 3.10)
project(geek_time_cpp)

# 设置通用编译选项
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_VERBOSE_MAKEFILE OFF)

# 添加公共头文件路径
include_directories(${PROJECT_SOURCE_DIR}/common)

# Windows 平台特定设置
if(WIN32)
    # MSVC 编译器设置
    if(MSVC)
        # 设置 MSVC 编译器的 UTF-8 支持
        add_compile_options(/utf-8)
        # 强制包含 utf8_output.h
        add_compile_options(/FI"utf8_output.h")
        # 设置为64位平台
        set(CMAKE_GENERATOR_PLATFORM x64)
    endif()

    # MinGW 编译器设置
    if(MINGW)
        # 添加注释
        # 启用所有警告选项
        # -Wall: 启用所有常见警告
        # -Wextra: 启用额外的警告选项
        # -pedantic: 严格遵守ISO C++标准
        # -Werror: 将所有警告视为错误
        add_compile_options(-Wall -Wextra)
        # 强制包含 utf8_output.h
        add_compile_options(-include utf8_output.h)
    endif()

    # Windows 平台通用设置
    include_directories(${PROJECT_SOURCE_DIR}/include)
endif()

# 添加子目录
# add_subdirectory(8)
add_subdirectory(9)
# 以下是被注释的子目录，需要时可以取消注释
# add_subdirectory(3_1)
# add_subdirectory(3_2)
# add_subdirectory(3_3)
# add_subdirectory(common)
# add_subdirectory(4_1)
# add_subdirectory(5)
# add_subdirectory(6)